/**
 * 
 */
package com.ihg.hiex.entity.session.during;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * @author downpour
 *
 */
@Alias("SessionInBasketCommunicationType")
public enum SessionInBasketCommunicationType {
    
    EMAIL("email", "email"),
    
    TEL("tel", "tel"),
    
    INTERVIEW("interview", "interview"),
    
    OTHER("other", "other");

    private String description;
    
    private String alias;
    
    /**
     * 
     * @param description
     * @param alias
     */
    SessionInBasketCommunicationType(String description, String alias) {
        this.description = description;
        this.alias = alias;
    }

    /**
     * 
     * @param alias
     * @return
     */
    public static SessionInBasketCommunicationType aliasOf(String alias) {
        for(SessionInBasketCommunicationType sessionInBasketCommunicationType : SessionInBasketCommunicationType.values()) {
            if(StringUtils.equalsIgnoreCase(sessionInBasketCommunicationType.getAlias(), alias)) {
                return sessionInBasketCommunicationType;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isEmail() {
        return this.equals(EMAIL);
    }
    
    /**
     * 
     * @return
     */
    public boolean isTel() {
        return this.equals(TEL);
    }
    
    /**
     * 
     * @return
     */
    public boolean isInterview() {
        return this.equals(INTERVIEW);
    }
    
    /**
     * 
     * @return
     */
    public boolean isOther() {
        return this.equals(OTHER);
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

}
